package cn.itcast.feign.clients;

import cn.itcast.feign.pojo.User;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//指定服务名称
@FeignClient("userservice")
public interface UserClient {


    /**
     * 这个方法实现的功能就是这两句代码
     * String url="http://userservice/user/"+ order.getUserId();
     * User user=restTemplate.getForObject(url, User.class);
     * @param id
     * @return
     */
    @GetMapping("/user/{id}")
    User findById(@PathVariable("id")Long id);
}
